home *** CD-ROM | disk | FTP | other *** search
/ Shirley Barber's Fairies: Create, Paint & Play / Fairies.iso / pc / Files / Cards.dxr / Internal_7_Print Card.ls < prev    next >
Encoding:
Text File  |  2003-09-29  |  2.5 KB  |  48 lines

  1. property pPreOrPri, pName, pWidth, pHeight, pScaling, stageRect, DestRect, pRect1, pRect2, pRect3, pRect4, sRect1, sRect2, sRect3, sRect4, dRect1, dRect2, dRect3, dRect4, pOriantation
  2.  
  3. on mouseUp me
  4.   doc = new(xtra("PrintOMatic"))
  5.   if not objectp(doc) then
  6.     alert("There is no currently selected printer.")
  7.     exit
  8.   end if
  9.   setDocumentName(doc, pName)
  10.   setMargins(doc, rect(pRect1, pRect2, pRect3, pRect4))
  11.   stageRect = rect(sRect1, sRect2, sRect3, sRect4)
  12.   DestRect = rect(dRect1, dRect2, dRect3, dRect4)
  13.   if pOriantation = "Portrait" then
  14.     setLandscapeMode(doc, 0)
  15.   else
  16.     setLandscapeMode(doc, 1)
  17.   end if
  18.   pWidth = getPageWidth(doc)
  19.   pHeight = getPageHeight(doc)
  20.   pScaling = min(1.0, float(pWidth) / float(stageRect[3] - stageRect[1]))
  21.   pScaling = min(pScaling, float(pHeight) / float(stageRect[4] - stageRect[2]))
  22.   DestRect = rect((pWidth / 2) + pRect1, 0, pWidth - 11, pHeight)
  23.   newPage(doc)
  24.   drawPicture(doc, member("Marbit"), point(0, 460))
  25.   drawStagePicture(doc, DestRect, stageRect, 1)
  26.   if pPreOrPri = "Print" then
  27.     if doJobSetup(doc) then
  28.       print(doc)
  29.     end if
  30.   end if
  31.   if pPreOrPri = "Preview" then
  32.     if doJobSetup(doc) then
  33.       printPreview(doc)
  34.     end if
  35.   end if
  36.   if pPreOrPri = "both" then
  37.     if doJobSetup(doc) then
  38.       printPreview(doc)
  39.       print(doc)
  40.     end if
  41.   end if
  42.   doc = 0
  43. end
  44.  
  45. on getPropertyDescriptionList
  46.   return [#pName: [#comment: "Name of Job:", #format: #string, #default: "StusJob"], #pPreOrPri: [#comment: "Options of print:", #format: #string, #default: "Print", #range: ["Print", "Preview", "Both"]], #pOriantation: [#comment: "Oriantation:", #format: #string, #default: "Portrait", #range: ["Portrait", "Landscape"]], #pRect1: [#comment: "Margins left:", #format: #integer, #default: 32], #pRect2: [#comment: "Margins top:", #format: #integer, #default: 32], #pRect4: [#comment: "Margins right:", #format: #integer, #default: 32], #pRect3: [#comment: "Margins bottom:", #format: #integer, #default: 32], #sRect1: [#comment: "Stage left:", #format: #integer, #default: 32], #sRect2: [#comment: "Stage top:", #format: #integer, #default: 32], #sRect3: [#comment: "Stage right:", #format: #integer, #default: 32], #sRect4: [#comment: "Stage bottom:", #format: #integer, #default: 32], #dRect1: [#comment: "Destination left:", #format: #integer, #default: 32], #dRect2: [#comment: "Destination top:", #format: #integer, #default: 32], #dRect3: [#comment: "Destination right:", #format: #integer, #default: 32], #dRect4: [#comment: "Destination bottom:", #format: #integer, #default: 32]]
  47. end
  48.